<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>煤炭管理系统</title>
    <link rel="stylesheet" href="/lib/layui/css/layui.css">
    <link rel="stylesheet" href="/lib/layui/css/layui-theme-custom.css">
    <link rel="stylesheet" href="/static/css/member.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <#include "/base/main-header.ftl">

    <#include "/base/main-left.ftl">
    <div class="layui-body">

        <!-- 内容主体区域  -->
        <div class="site-title">
            <fieldset>
                <legend>
                    <a class="site-title-text">基本情况</a>
                </legend>
            </fieldset>
        </div>
        <div class="table-box">

            <table class="layui-table" lay-skin="line">
                <col width="15%">
                <col width="20%">
                <col width="15%">
                <col width="40%">
                <tbody>
                <tr>
                    <td><label class="form-label">供应商名称：</label></td>
                    <td>${supplier.name}</td>

                    <td><label class="form-label">组织机构代码：</label></td>
                    <td>${supplier.code}</td>
                </tr>
                <tr>
                    <td><label class="form-label">供应商简称：</label></td>
                    <td>${supplier.shortname}</td>
                    <td><label class="form-label">法人代表：</label></td>
                    <td>${supplier.corporation}</td>
                </tr>
                <tr>
                    <td><label class="form-label">法人代表身份证：</label></td>
                    <td>${supplier.corporationidentity}</td>
                    <td><label class="form-label">注册资金(万元)：</label></td>
                    <td>${supplier.financing}万元</td>
                </tr>
                <tr>
                    <td><label class="form-label">税务登记证代码：</label></td>
                    <td>${supplier.taxcode}</td>
                    <td><label class="form-label">经营执照编号：</label></td>
                    <td>${supplier.licence}</td>
                </tr>
                <tr>
                    <td><label class="form-label">开户银行：</label></td>
                    <td>${supplier.openbank}</td>
                    <td><label class="form-label">账号：</label></td>
                    <td>${supplier.bankaccount}</td>
                </tr>
                <tr>
                    <td><label class="form-label">公司注册地址：</label></td>
                    <td>${supplier.registerplace}</td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td><label class="form-label">联系人：</label></td>
                    <td>${supplier.linkman}</td>
                    <td><label class="form-label">联系电话：</label></td>
                    <td>${supplier.linktel}</td>
                </tr>
                <tr>
                    <td><label class="form-label">传真：</label></td>
                    <td>${supplier.faxcode}</td>
                    <td><label class="form-label">邮政编码：</label></td>
                    <td>${supplier.postalcode}</td>
                </tr>
                <tr>
                    <td><label class="form-label">联系地址：</label></td>
                    <td>${supplier.address}</td>
                    <td><label class="form-label">电子邮箱：</label></td>
                    <td>${supplier.conemail}</td>
                </tr>
                <tr>
                    <td><label class="form-label">煤源存放地点、数量、质量：</label></td>
                    <td>${supplier.coalsource}</td>
                    <td><label class="form-label">运输方式及保障能力：</label></td>
                    <td>${supplier.transportmode}</td>
                </tr>
                </tbody>
            </table>
        </div>
        <br>

        <div class="site-title">
            <fieldset>
                <legend>
                    <a class="site-title-text">附件信息</a>
                </legend>
            </fieldset>
        </div>
        <div class="table-box" id="lphotos">
            <table class="layui-table" lay-skin="line">
                <thead>
                <tr>
                    <th>序号</th>
                    <th>预览</th>
                    <th>类型</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td>1</td>
                    <td><img  layer-src="${supplier.idcardurl}" src="${supplier.idcardurl}" alt="身份证"></td>
                    <td><a href="#" class="enclosure">法人身份证</a></td>
                </tr>
                <tr>
                    <td>2</td>
                    <td><img  layer-src="${supplier.businesslicurl}" src="${supplier.businesslicurl}" alt="营业执照"></td>
                    <td><a href="#" class="enclosure">营业执照</a></td>
                </tr>

                </tbody>
            </table>
        </div>
        <br>


        <br><br>

        <div style="text-align:center">

            <button class="layui-btn layui-btn-radius" id="tz" >调整供应商类别</button>
            <a href="/dispSupplier"><button class="layui-btn layui-btn-radius layui-btn-primary">返回</button></a>

        </div>
        <br><br><br>
    </div>
    <#include "/base/main-footer.ftl">
</div>

<script src="/static/lib/layui/layui.js"></script>
<script>
    layui.use(['layer', 'form', 'element', 'jquery','table'], function () {
        let layer = layui.layer, form = layui.form, $ = layui.$, table = layui.table;
           var level='0';
           $("#tz").click(function (){
               layer.open({
                   type:1,
                   area: ['500px', '300px'],
                   content:$("#tzx"),
                   btn:['确定','返回'],
                   yes:function(){
                       level=$("#level").val();
                       console.log(level);
                           $.post("/changeclevel.do",{id:${RequestParameters['id']},level:level},function (data) {
                                if (data.isSuccess){
                                     layer.msg("成功修改!");
                                     setTimeout('window.location="/dispSupplier"',1000);
                                 } else {
                                     layer.msg(data.msg)
                                 }
                           })

                   }

               });


        });

        layer.photos({
             photos:"#lphotos",

        });


    });
</script>
</body>
<div id="tzx" style="display: none">
    <form class="layui-form">
    <div style="margin-left: 20px">供应商当前类别：${supplier.creditlevel}</div>
        <label class="layui-form-label" style="margin-top: 50px">调整为:</label>
    <div class="layui-input-block" style="margin-top: 50px">
        <select id="level" lay-verify="">
            <option value="临时供应商">临时供应商</option>
            <option value="一般供应商">一般供应商</option>
            <option value="内部供应商">内部供应商</option>
            <option value="重点供应商">重点供应商</option>
        </select>
    </div>
    </form>

</div>
</html>